/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
function updateProduct(productID){
    var xmlRequest = new XMLHttpRequest();
    if (xmlRequest){
        var productName = document.getElementById("txtName" + productID).value;
        var price = document.getElementById("txtprice" + productID).value;
        var des = document.getElementById("txtdescription" + productID).value;
        var url = "AdminController?btnAction=editProduct";
        //open connection
        xmlRequest.open("POST", url, true);

        xmlRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");

        //send request
        xmlRequest.send("&productID=" + productID + "&productName=" +productName + "&price=" + price + "&description=" + des);
        return false;
    } else {
        return true;
    }
}

